var deasync = require('deasync');

function get_data() {
    let isReturn = false
    let result = 0;
    Promise.resolve()
        .then(() => {
            isReturn = true
            result = 100
        })

    while (!isReturn) {
        deasync.runLoopOnce()
    }

    return result;
}

// console.log(get_data())